export default class Queue {
  constructor() {
    this.arr = [];
  }
  // 入栈
  enqueue(ele) {
    this.arr.push(ele);
  }
  // 出栈
  dequeue() {
    return this.arr.shift();
  }
  // 返回队列第一个元素
  front() {
    return this.arr[0];
  }
  isEmpty() {
    return this.arr.length === 0;
  }
  size() {
    return this.arr.length;
  }
  toString() {
    var str = "";
    for (var i = 0; i < this.arr.length; i++) {
      str += this.arr[i] + " ";
    }
    return str;
  }
}
